<?php

use yii\helpers\Html;
use yii\widgets\Pjax;
use backend\modules\Product\widgets\EntityDetail;

/* @var $this yii\web\View */
/* @var $model common\models\c2\entity\Product */

if ($model->isNewRecord) {
    $this->title = Yii::t('app.c2', '{actionTips} {modelClass}: ', ['actionTips' => Yii::t('app.c2', 'Create'), 'modelClass' => Yii::t('app.c2', 'Product'),]);
    $this->params['breadcrumbs'][] = ['label' => Yii::t('app.c2', 'Products'), 'url' => ['index']];
    $this->params['breadcrumbs'][] = $this->title;
} else {
    $this->title = Yii::t('app.c2', '{actionTips} {modelClass}: ', ['actionTips' => Yii::t('app.c2', 'Update'), 'modelClass' => Yii::t('app.c2', 'Product'),]) . ' ' . $model->id;
    $this->params['breadcrumbs'][] = ['label' => Yii::t('app.c2', 'Products'), 'url' => ['index']];
    $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
    $this->params['breadcrumbs'][] = Yii::t('app.c2', 'Update');
}
?>

<?php Pjax::begin(['id' => $model->getDetailPjaxName(), 'formSelector' => $model->getBaseFormName(true), 'enablePushState' => false, 'clientOptions' => [
    'skipOuterContainers' => true
]]) ?>

<?php echo EntityDetail::widget([
    'model' => $model,
    'tabTitle' => $this->title,
    'withEavTab' => true,
    'withSkuTab' => true,
    'withPackageTab' => true,
    'withStockTab' => true,
]);
?>

<?php Pjax::end() ?>

